const secondHand =document.querySelector('.second-hand')  //获取秒针的dom结构
const minHand =document.querySelector('.min-hand') 
const hourHand =document.querySelector('.hour-hand') 
//console.log(secondHand,minHand,hourHand)
function setDate(){
const now=new Date()
//获取到当前秒 
const seconds=now.getSeconds()
const secondsDegrees= ((seconds/60) * 360) +90;
//console.log(secondsDegrees);
secondHand.style.transform = `rotate(${secondsDegrees}deg)`

const mins=now.getMinutes()
const minsDegrees= ((mins/60) * 360)+((seconds/60) * 6)+90;
//console.log(secondsDegrees);
minHand.style.transform = `rotate(${minsDegrees}deg)`

const hours=now.getHours()
const hoursDegrees= ((hours/12) * 360) +((mins/60)*6)+90+((seconds/360)*30);
//console.log(secondsDegrees);
hourHand.style.transform = `rotate(${hoursDegrees}deg)`
}
setInterval(setDate,1000) //每秒调动函数
setDate()